An important feature of database systems is replication. Replication is the process of replicating data from a “source” database server onto another database server, herein referred to as a destination database server. As changes are made to user data on the source database server, the changes are replicated on the destination database server.
Under this approach, the changes made to data blocks on the source database of the source database server are made to replicas of those data blocks on a destination database of a destination database server. Because the source database is replicated at the lowest atomic level of storage space on the destination database, the destination database is a physical replica of the source database.
Another approach to replicating data is the logical replication approach. Under the logical replication approach, transactions that change data on the source database server (“source transaction”) are applied as a transaction on the destination database server (“apply transaction”). Because logical replication relies on transaction processing, a description of transaction processing is useful.
Changes to database systems may be made using transaction processing. A transaction is a set of operations that change data. In database systems, the operations are specified by one or more database commands. Committing a transaction refers to making the changes for a transaction permanent.
Under transaction processing, all the changes for a transaction are made atomically. When a transaction is committed, either all changes are committed, or the transaction is rolled back. Because the changes are not permanent until a transaction is committed, the changes for a transaction may not be replicated on a logical standby until the transaction is committed on the primary database. After a transaction is committed on the primary database server, the transactions are re-executed and committed on the source database server.
The term database state, as used herein, refers to values in a database (or any set of data base objects updated through transaction processing) that exist when a particular transaction is committed. As transactions are committed, a database transitions from one database state to another database state.
To replicate data on a logical destination database server more quickly and efficiently, apply transactions may be executed in parallel. Transactions may be executed in parallel by multiple processes, each process executing one of the transactions.
However, there is a need to preserve transaction dependency between certain transactions. Preserving transaction dependency can greatly impede the degree of parallelism that can be achieved and ultimately the scalability of logical replication.
Based on the foregoing, it is clearly desirable to develop an approach that improves the level of parallelism that can be achieved for logical replication.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.